﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsList.aspx.cs" Inherits="NewsList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <%=sbNewsList.ToString() %>
        <div>
            <asp:Button ID="btnDel" runat="server" OnClick="btnDel_Click" Text="删除" OnClientClick="return chkDel();" />
            &nbsp;<asp:Button ID="btnPost" runat="server" OnClick="btnPost_Click" Text="签发" OnClientClick="return chkPost();" />
        </div>
    </div>
    </form>
    <script type="text/javascript">
        var chkIDLen = document.getElementsByName("chkID")
        function chk() {
            var flag = false;
            for (var i = 0; i < chkIDLen.length; i++) {
                if (document.getElementById("chkID_" + i).checked == true) {
                    flag = true;
                    break;
                }
            }
            return flag;
        }

        function chkDel() {
            var flag = chk();
            if (flag == false)
                alert("请选择要删除的行！");
            return flag;
        }
        function chkPost() {
            var flag = chk();
            if (flag == false)
                alert("请选择要签发的行！");
            return flag;
        }

        function chkAll() {
            if (document.getElementById("chkIDAll").checked == true) {
                for (var i = 0; i < chkIDLen.length; i++) {
                    document.getElementById("chkID_" + i).checked = true;
                }
            } else {
                for (var i = 0; i < chkIDLen.length; i++) {
                    document.getElementById("chkID_" + i).checked = false;
                }
            }
        }
    </script>
</body>
</html>
